function [UpdateProx] = BoxesProximityUpdate(IsCane,Boxes)

NBoxes = numel(Boxes.BoxSize);
UpdateProx = zeros(size(Boxes.SingleIdx{1},1),NBoxes);

for i = 1:NBoxes
    ListBoxesInCane = unique(IsCane.*Boxes.SingleIdx{i});
    [UpdateProx(:,i)] = ismember(Boxes.SingleIdx{i},ListBoxesInCane);
end
